import request from '@/utils/request'

// 查询订单列表
export function listOrder(query) {
  return request({
    url: '/hmk/order/list',
    method: 'get',
    params: query
  })
}

// 查询订单详细
export function getOrder(id) {
  return request({
    url: '/hmk/order/' + id,
    method: 'get'
  })
}

export function getOrderDetailById(id) {
  return request({
    url: '/hmk/order/getOrderDetailById/' + id,
    method: 'get'
  })
}

//这个接口功能和getOrderDetailById一致,只是为了区分角色,,所以复制了一个
export function getOrderFollowDetailById(id) {
  return request({
    url: '/hmk/order/getOrderFollowDetailById/' + id,
    method: 'get'
  })
}


//获取号码仓的title
export function getSupplierTitle(data) {
  return request({
    url: '/hmk/order/getSupplierTitle/',
    method: 'post',
    data: data
  })
}


//将订单改为交易成功
export function updateState6(data) {
  return request({
    url: '/hmk/order/updateState6',
    method: 'post',
    data: data
  })
}

export function batchUpdateState6(data) {
  return request({
    url: '/hmk/order/batchUpdateState6',
    method: 'post',
    data: data
  })
}

// 新增订单
export function addOrder(data) {
  return request({
    url: '/hmk/order',
    method: 'post',
    data: data
  })
}


//审核成功
export function auditSuccess(data) {
  return request({
    url: '/hmk/order/auditSuccess',
    method: 'post',
    data: data
  })
}

//审核失败
export function auditFail(data) {
  return request({
    url: '/hmk/order/auditFail',
    method: 'post',
    data: data
  })
}


// 修改订单
export function updateOrder(data) {
  return request({
    url: '/hmk/order',
    method: 'put',
    data: data
  })
}

//维系人修改保存
export function editByIdAndCurrent(data) {
  return request({
    url: '/hmk/order/editByIdAndCurrent',
    method: 'put',
    data: data
  })
}

//修改实名订单状态
export function editOrderState5(data) {
  return request({
    url: '/hmk/order/editOrderState5',
    method: 'put',
    data: data
  })
}

//修改订单交易失败按钮
export function editOrderLoser(data) {
  return request({
    url: '/hmk/order/editOrderLoser',
    method: 'put',
    data: data
  })
}


export function editOrderActivation(data) {
  return request({
    url: '/hmk/order/editOrderActivation',
    method: 'put',
    data: data
  })
}

export function editOrderByDeal(data) {
  return request({
    url: '/hmk/order/editOrderByDeal',
    method: 'put',
    data: data
  })
}


export function editOrderAuthBack(data) {
  return request({
    url: '/hmk/order/editOrderAuthBack',
    method: 'put',
    data: data
  })
}

export function editOrderByRecall(data) {
  return request({
    url: '/hmk/order/editOrderByRecall',
    method: 'put',
    data: data
  })
}

export function editOrderByCancellation(data) {
  return request({
    url: '/hmk/order/editOrderByCancellation',
    method: 'put',
    data: data
  })
}


//修改报账
export function editOrderBaoZhang(data) {
  return request({
    url: '/hmk/order/editOrderBaoZhang',
    method: 'put',
    data: data
  })
}


//添加跟进
export function editOrderAddGenJin10(data) {
  return request({
    url: '/hmk/order/editOrderAddGenJin10',
    method: 'put',
    data: data
  })
}

export function batchAddGenJin(data) {
  return request({
    url: '/hmk/order/batchAddGenJin',
    method: 'put',
    data: data
  })
}


//用户信息
export function editOrderAddGenJin20(data) {
  return request({
    url: '/hmk/order/editOrderAddGenJin20',
    method: 'put',
    data: data
  })
}

//添加物流
export function editOrderAddGenJin30(data) {
  return request({
    url: '/hmk/order/editOrderAddGenJin30',
    method: 'put',
    data: data
  })
}

//打标签
export function editOrderAddGenJin40(data) {
  return request({
    url: '/hmk/order/editOrderAddGenJin40',
    method: 'put',
    data: data
  })
}


export function getIdentityVisible(data) {
  return request({
    url: '/hmk/order/getIdentityVisible',
    method: 'post',
    data: data
  })
}

export function getPhoneVisible(data) {
  return request({
    url: '/hmk/order/getPhoneVisible',
    method: 'post',
    data: data
  })
}

export function getSupplierNameVisible(data) {
  return request({
    url: '/hmk/order/getSupplierNameVisible',
    method: 'post',
    data: data
  })
}


export function handDecrypt(data) {
  return request({
    url: '/hmk/order/handDecrypt',
    method: 'post',
    data: data
  })
}

export function updateByTelNumber(data) {
  return request({
    url: '/hmk/order/updateByTelNumber/',
    method: 'post',
    data: data
  })
}

export function updateOrderTelAndForce(data) {
  return request({
    url: '/hmk/order/updateOrderTelAndForce/',
    method: 'post',
    data: data
  })
}

export function takeOrder(data) {
  return request({
    url: '/hmk/order/takeOrder/',
    method: 'post',
    data: data
  })
}


export function deleteAttachment(data) {
  return request({
    url: '/hmk/order/deleteAttachment/',
    method: 'post',
    data: data
  })
}

export function ksDeleteAttachment(data) {
  return request({
    url: '/hmk/order/ksDeleteAttachment/',
    method: 'post',
    data: data
  })
}


export function updateReceiveOrderUserId(data) {
  return request({
    url: '/hmk/order/updateReceiveOrderUserId/',
    method: 'post',
    data: data
  })
}

export function updateSupplier(data) {
  return request({
    url: '/hmk/order/updateSupplier/',
    method: 'post',
    data: data
  })
}

export function updateDouDianOrderManageAuthorId(data) {
  return request({
    url: '/hmk/order/updateDouDianOrderManageAuthorId/',
    method: 'post',
    data: data
  })
}

export function updateIdentityNumber(data) {
  return request({
    url: '/hmk/order/updateIdentityNumber/',
    method: 'post',
    data: data
  })
}


export function updateFirstChargePrice(data) {
  return request({
    url: '/hmk/order/updateFirstChargePrice/',
    method: 'post',
    data: data
  })
}

export function updateGaiJia(data) {
  return request({
    url: '/hmk/order/updateGaiJia/',
    method: 'post',
    data: data
  })
}

export function batchUpdatePrice(data) {
  return request({
    url: '/hmk/order/batchUpdatePrice/',
    method: 'post',
    data: data
  })
}

export function getKsTempUrl(data) {
  return request({
    url: '/hmk/order/images/getKsTempUrl/',
    method: 'post',
    data: data
  })
}


export function ksAddAuditUserId(data) {
  return request({
    url: '/hmk/order/ksAddAuditUserId/',
    method: 'post',
    data: data
  })
}


// 删除订单
export function delOrder(id) {
  return request({
    url: '/hmk/order/' + id,
    method: 'delete'
  })
}


export function getReceiveOrderMainSwitchByUserId(query) {
  return request({
    url: '/hmk/order/getReceiveOrderMainSwitchByUserId',
    method: 'get',
    params: query
  })
}

//获取渠道列表
export function orderChannelSimpleList() {
  return request({
    url: '/hmk/order/orderChannelSimpleList',
    method: 'get'
  })
}


export function getAttachmentImagesByFollowId(query) {
  return request({
    url: '/hmk/order/getAttachmentImagesByFollowId',
    method: 'get',
    params: query
  })
}

//获取商品列表
export function douDianGoodsList() {
  return request({
    url: '/hmk/order/douDianGoodsList',
    method: 'get'
  })
}


export function uploadOrderImages(formData) {
  return request({
    url: '/hmk/order/images/upload',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data' // 必须手动设置
    }
  })
}


export function uploadOrderAudios(formData) {
  return request({
    url: '/hmk/order/audio/upload',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data' // 必须手动设置
    }
  })
}


export function getTempUrl(objectPath) {
  return request({
    url: '/hmk/order/images/getTempUrl',
    data: objectPath,
    method: 'post'
  })
}


export function addKsOrderReplyLogAndUpload(formData) {
  return request({
    url: '/hmk/order/addKsOrderReplyLogAndUpload',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data' // 必须手动设置
    }
  })
}



